package edu.bailie.springmvc.mybatis;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;

public class MybatisTest {


	public static void main(String[] args) {
		SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder();

		InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("mybatis-config.xml");
//	SqlSessionFactory
		SqlSessionFactory sqlSessionFactory = sqlSessionFactoryBuilder.build(inputStream);
//	SqlSession
		SqlSession sqlSession = sqlSessionFactory.openSession();


		int insertCar = sqlSession.insert("insertCar");
		sqlSession.commit();
		sqlSession.close();


	}


}



